package gui;

import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class MainFrame extends JFrame {

    /**.
     * Glowny listner
     */
	public static final GuiActions MAIN_LISTENER = new GuiActions(); 
	public MainFrame(String name, int widthFrame, int heightFrame) {
		setTitle(name);
		setSize(widthFrame, heightFrame);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			e.printStackTrace();
		}

		this.run();
	}
	


	public void run() {
		
		add(new login());
		pack();
		setResizable(false);
		setVisible(true);
		setSize(new Dimension(800,600));
		Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension ekran = toolkit.getScreenSize();
        setLocation((ekran.width-800)/2, (ekran.height-600)/2); 
	}
}
